package com.fos.BluetoothStory.model;

import java.io.Serializable;

/**
 * 歌曲数据model
 * @author fanxing 创建于 Oct 22, 2015
 */
public class MusicBean implements Serializable {
	public static final int LPID = 5;//本地音乐目录id

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public int pid;//所属分类id
	public int id;//音乐id, 歌曲编号
	public long duration;//时长
	public long size;//文件大小
	public String artist;//艺术家
	public String title;//音乐标题, 歌曲名称
	public String url;//文件路径
	public String album;//唱片图片
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((album == null) ? 0 : album.hashCode());
		result = prime * result + ((artist == null) ? 0 : artist.hashCode());
		result = prime * result + (int) (duration ^ (duration >>> 32));
		result = prime * result + id;
		result = prime * result + pid;
		result = prime * result + (int) (size ^ (size >>> 32));
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MusicBean other = (MusicBean) obj;
		if (album == null) {
			if (other.album != null)
				return false;
		} else if (!album.equals(other.album))
			return false;
		if (artist == null) {
			if (other.artist != null)
				return false;
		} else if (!artist.equals(other.artist))
			return false;
		if (duration != other.duration)
			return false;
		if (id != other.id)
			return false;
		if (pid != other.pid)
			return false;
		if (size != other.size)
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}
	
	
}
